import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import 'dayjs/locale/zh-cn'
const app = createApp(App)



import router from './router'
import pinia from './pinia'
import './permission'

import './assets/css/clear.scss';
// 注册自定义指令
import * as Directives from '@/directive'
Object.values(Directives).forEach(fn => fn(app))

const iconArr = [
  'Menu','HelpFilled','CaretBottom','Expand','Fold','ArrowDown',
  'SuccessFilled','CircleCloseFilled','User','UserFilled','Lock',
  'Tools','Histogram',,'WarnTriangleFilled','Avatar','Management',
  'WalletFilled','PictureFilled','Connection','GoodsFilled','MagicStick',
  'DataAnalysis','HomeFilled','Flag','Promotion','Stamp','Service'
]
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  if(iconArr.indexOf(key) > -1) app.component(key, component)
}
app.use(pinia)
.use(router)
.use(ElementPlus,{ locale:zhCn, size: 'default', zIndex: 3000 })
.mount('#app')
